home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / SELUSRPR.HDR < prev    next >
Text File  |  1994-04-25  |  4KB  |  128 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _SelectUsrPrint( cPrintType ) --> NIL
  8.  
  9. PARAMETERS:
  10.  
  11. cPrintType: Print Type to set
  12.  
  13. SHORT:
  14.  
  15. Set various printer settings for printers defined in PRINTDEF.DAT.
  16.  
  17. DESCRIPTION:
  18.  
  19. _SetUsrPrint() and _SelUsrPrint() are responsible for creating (if necessary)
  20. and maintaining two databases that store information on printer setup codes,
  21. and default printers for users.
  22.  
  23. The first database, PRINTDEF.DAT, contains printers and their respective
  24. setup codes for various print attributes.  On the first call to either
  25. _SetUsrPrint() or _SelUsrPrint(), if the PRINTDEF.DAT database does not
  26. exist, it is created with three predefined printer drivers: HP LaserJet,
  27. Epson FX/MX/LQ, and IBM Proprinter II.
  28.  
  29. Valid Print Settings are:
  30.  
  31. COMPRESS  : Compress Print
  32. BOLD      : Bold Print
  33. UNDERLINE : Underline Print
  34. RESET     : Reset Print Codes to Default
  35. CUSTOM_1  : Custom
  36. CUSTOM_2  : Custom
  37. CUSTOM_3  : Custom
  38. CUSTOM_4  : Custom
  39.  
  40. Each printer driver record contains the following fields:
  41.  
  42. PRINT_NUM  : Printer Number
  43. PRINT_NAME : Printer Name
  44. COMPRESS   : Code for Condensed Print
  45. BOLD       : Code for Bold Print (Double Strike for Dot matrix)
  46. RESET      : Reset Code
  47. CUSTOM_1   : Custom Code Slot 1
  48. CUSTOM_2   :                  2
  49. CUSTOM_3   :                  3
  50. CUSTOM_4   :                  4
  51.  
  52. The CUSTOM fields can be used to carry printer codes that are specific to the
  53. particular printer.  I.E., Landscape is only applicable to Laser Printers,
  54. and Underline is not a part of any normal selectable font on most dot matrix
  55. printers.  For that reason, these codes can be set in the CUSTOM_X fields and
  56. selected in the calling application.
  57.  
  58. For instance, to use LANDSCAPE on the HP LaserJet, request CUSTOM_2.  You
  59. might want to use the Clipper Preprocessor to make this clear:
  60.  
  61. #define HP_UNDERLINE 'CUSTOM_2'
  62.  
  63. _SelUsrPrint(HP_UNDERLINE)
  64.  
  65. On the first call to either _SetUsrPrint() or _SelUsrPrint(), if the
  66. PRINTDEF.DAT file does not exist, it is created with three predefined printer
  67. drivers.
  68.  
  69. The Custom Fields available for these are:
  70.  
  71. HP LaserJet:
  72.  
  73. Custom_1: Portrait
  74. Custom_2: Landscape
  75. Custom_3: Underline
  76.  
  77. Epson FX/MX/LQ:
  78.  
  79. Custom_1: Near Letter Quality
  80. Custom_2: Italics
  81.  
  82. IBM ProPrinter II / IBM Graphics:
  83.  
  84. Custom_1: Near Letter Quality
  85.  
  86. The SECOND database is USERPRIN.DAT.  This database contains only two fields:
  87.  
  88. USER_NAME: User Name as set in DOS Environment Variable U_NAME
  89. PRINTER  : Number of Selected Printer.
  90.  
  91. The PRINTER number is used to relate each user to their selected printer
  92. driver.  U_NAME MUST be set as a DOS Environment Variable BEFORE the program
  93. starts:
  94.  
  95. SET U_NAME=PKWALLACE
  96.  
  97. When the _SetUsrPrint() function is called, a pick-box is presented with the
  98. three default printer names and any others that have been specifically added.
  99. The user picks one from the list.
  100.  
  101. _SetUsrPrint() then saves the user name (U_NAME) and the printer number in
  102. the USERPRIN.DAT database.
  103.  
  104. When _SelUsrPrint() is called, the user name (U_NAME) is located in the
  105. USERPRIN.DAT database, the printer number is retrieved and used as a select
  106. into the PRINTDEF.DAT database to retrieve the code for the correct printer.
  107.  
  108. All Characters AFTER the first SPACE in the printer code fields are ignored
  109. (allowing comments).  (i.e., "<ESC>E This is a Reset")
  110.  
  111. NOTE:
  112.  
  113.  
  114.  
  115. EXAMPLE:
  116.  
  117. _SetUsrPrint(10,10,15,45,'w+/n')
  118. _SelUsrPrint('COMPRESS')
  119.  
  120. Result: _SetUsrPrint() records the printer number of the printer selected
  121. from the pick list (whatever it is).
  122.  
  123. _SelUsrPrint() then sets compressed print from the COMPRESS field from
  124. the record that contains the user number of the printer selected
  125. by _SelUsrPrint().
  126.  
  127. ******************************************************************************/
  128.